package com.aigc.sclassroom.component;

import com.aigc.sclassroom.service.HomeworkService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.beans.factory.annotation.Autowired;

@Component
public class HomeworkStatusUpdater {

    @Autowired
    private HomeworkService homeworkService;
    // 每隔 1 分钟执行一次
    @Scheduled(fixedRate = 60000) // 单位：毫秒
    public void updateHomeworkStatus() {
        homeworkService.updateStatusToExpired();
    }
}